package response

import "company_website/src/model/common"

type GetNewInfoById struct {
	*GetNewResInfo
	Status int `json:"status" form:"status"`
}
type GetNewResInfo struct {
	Title   string `json:"title" form:"title"`
	Content string `json:"content" form:"content"`
	Time    int    `json:"time" form:"time"`
}

func (GetNewInfoById) TableName() string {
	return "new"
}

type New struct {
	Id      int    `gorm:"primary_key;AUTO_INCREMENT" json:"id" form:"id"`
	Url     string `gorm:"size:255;unique" json:"url" form:"url"`
	Title   string `json:"title" form:"title"`
	Content string `json:"content" form:"content"`
	Time    int    `json:"time" form:"time"`
}

func (New) TableName() string {
	return "new"
}

type News struct {
	News []New `json:"news" form:"news"`
}

func (News) TableName() string {
	return "new"
}

type KnowMoreNews struct {
	KnowMoreNewsInfo []KnowMoreNew `json:"know_more_news" form:"know_more_news"`
}

type KnowMoreNew struct {
	Id      int    `gorm:"primary_key;AUTO_INCREMENT" json:"id" form:"id"`
	Title   string `json:"title" form:"title"`
	Content string `json:"content" form:"content"`
	Time    int    `json:"time" form:"time"`
}

func (KnowMoreNew) TableName() string {
	return "new"
}
func (KnowMoreNews) TableName() string {
	return "new"
}

type SearchArticle struct {
	Title   string `json:"title" form:"title"`
	Url     string `json:"url" form:"url"`
	Content string `json:"content" form:"content"`
	Time    int    `json:"time" form:"time"`
}
type SearchArticles struct {
	Articles []SearchArticle `json:"articles" form:"articles"`
}

func (SearchArticles) TableName() string {
	return "new"
}
func (SearchArticle) TableName() string {
	return "new"
}

type GetNewList struct {
	PageReqInfo *common.PageReqInfo `json:"page_req_info" `
	News        News                `json:"news"`
}
